import 'dart:convert';

import 'package:riverpod_t/generated/json/base/json_field.dart';
import 'package:riverpod_t/generated/json/cartoon_model_entity.g.dart';

@JsonSerializable()
class CartoonModelData {
  List<CartoonModelDataFeeds>? feeds;
  @JSONField(name: "show_times")
  int? showTimes;

  CartoonModelData();

  factory CartoonModelData.fromJson(Map<String, dynamic> json) => $CartoonModelDataFromJson(json);

  Map<String, dynamic> toJson() => $CartoonModelDataToJson(this);

  CartoonModelData copyWith({List<CartoonModelDataFeeds>? feeds, int? showTimes}) {
    return CartoonModelData()
      ..feeds = feeds ?? this.feeds
      ..showTimes = showTimes ?? this.showTimes;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class CartoonModelDataFeeds {
  @JSONField(name: "item_id")
  String? itemId;
  @JSONField(name: "parent_id")
  String? parentId;
  String? title;
  @JSONField(name: "jump_value")
  String? jumpValue;
  int? type;
  String? image;
  CartoonModelDataFeedsIcons? icons;
  CartoonModelDataFeedsDescription? description;
  CartoonModelDataFeedsShop? shop;
  @JSONField(name: "comic_info")
  CartoonModelDataFeedsComicInfo? comicInfo;
  List<CartoonModelDataFeedsLabels>? labels;
  CartoonModelDataFeedsCombine? combine;
  CartoonModelDataFeedsRank? rank;
  @JSONField(name: "ip_product")
  CartoonModelDataFeedsIpProduct? ipProduct;
  @JSONField(name: "novel_info")
  CartoonModelDataFeedsNovelInfo? novelInfo;
  bool isLike = false;

  CartoonModelDataFeeds();

  factory CartoonModelDataFeeds.fromJson(Map<String, dynamic> json) =>
      $CartoonModelDataFeedsFromJson(json);

  Map<String, dynamic> toJson() => $CartoonModelDataFeedsToJson(this);

  CartoonModelDataFeeds copyWith({
    String? itemId,
    String? parentId,
    String? title,
    String? jumpValue,
    int? type,
    String? image,
    CartoonModelDataFeedsIcons? icons,
    CartoonModelDataFeedsDescription? description,
    CartoonModelDataFeedsShop? shop,
    CartoonModelDataFeedsComicInfo? comicInfo,
    List<CartoonModelDataFeedsLabels>? labels,
    CartoonModelDataFeedsCombine? combine,
    CartoonModelDataFeedsRank? rank,
    CartoonModelDataFeedsIpProduct? ipProduct,
    CartoonModelDataFeedsNovelInfo? novelInfo,
  }) {
    return CartoonModelDataFeeds()
      ..itemId = itemId ?? this.itemId
      ..parentId = parentId ?? this.parentId
      ..title = title ?? this.title
      ..jumpValue = jumpValue ?? this.jumpValue
      ..type = type ?? this.type
      ..image = image ?? this.image
      ..icons = icons ?? this.icons
      ..description = description ?? this.description
      ..shop = shop ?? this.shop
      ..comicInfo = comicInfo ?? this.comicInfo
      ..labels = labels ?? this.labels
      ..combine = combine ?? this.combine
      ..rank = rank ?? this.rank
      ..ipProduct = ipProduct ?? this.ipProduct
      ..novelInfo = novelInfo ?? this.novelInfo;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class CartoonModelDataFeedsIcons {
  @JSONField(name: "allow_wait_free")
  bool? allowWaitFree;
  @JSONField(name: "discount_type")
  int? discountType;
  @JSONField(name: "single_icon")
  int? singleIcon;
  @JSONField(name: "double_icon")
  int? doubleIcon;
  @JSONField(name: "new_comic")
  bool? newComic;

  CartoonModelDataFeedsIcons();

  factory CartoonModelDataFeedsIcons.fromJson(Map<String, dynamic> json) =>
      $CartoonModelDataFeedsIconsFromJson(json);

  Map<String, dynamic> toJson() => $CartoonModelDataFeedsIconsToJson(this);

  CartoonModelDataFeedsIcons copyWith({
    bool? allowWaitFree,
    int? discountType,
    int? singleIcon,
    int? doubleIcon,
    bool? newComic,
  }) {
    return CartoonModelDataFeedsIcons()
      ..allowWaitFree = allowWaitFree ?? this.allowWaitFree
      ..discountType = discountType ?? this.discountType
      ..singleIcon = singleIcon ?? this.singleIcon
      ..doubleIcon = doubleIcon ?? this.doubleIcon
      ..newComic = newComic ?? this.newComic;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class CartoonModelDataFeedsDescription {
  String? description;
  String? ext;

  CartoonModelDataFeedsDescription();

  factory CartoonModelDataFeedsDescription.fromJson(Map<String, dynamic> json) =>
      $CartoonModelDataFeedsDescriptionFromJson(json);

  Map<String, dynamic> toJson() => $CartoonModelDataFeedsDescriptionToJson(this);

  CartoonModelDataFeedsDescription copyWith({String? description, String? ext}) {
    return CartoonModelDataFeedsDescription()
      ..description = description ?? this.description
      ..ext = ext ?? this.ext;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class CartoonModelDataFeedsShop {
  int? price;
  @JSONField(name: "deposit_price")
  int? depositPrice;
  @JSONField(name: "wish_count")
  int? wishCount;

  CartoonModelDataFeedsShop();

  factory CartoonModelDataFeedsShop.fromJson(Map<String, dynamic> json) =>
      $CartoonModelDataFeedsShopFromJson(json);

  Map<String, dynamic> toJson() => $CartoonModelDataFeedsShopToJson(this);

  CartoonModelDataFeedsShop copyWith({int? price, int? depositPrice, int? wishCount}) {
    return CartoonModelDataFeedsShop()
      ..price = price ?? this.price
      ..depositPrice = depositPrice ?? this.depositPrice
      ..wishCount = wishCount ?? this.wishCount;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class CartoonModelDataFeedsComicInfo {
  String? decision;
  @JSONField(name: "lastest_short_title")
  String? lastestShortTitle;
  @JSONField(name: "is_finish")
  int? isFinish;
  @JSONField(name: "main_style_name")
  String? mainStyleName;
  @JSONField(name: "rank_info")
  CartoonModelDataFeedsComicInfoRankInfo? rankInfo;
  double? score;
  List<String>? styles;
  List<String>? tags;

  CartoonModelDataFeedsComicInfo();

  factory CartoonModelDataFeedsComicInfo.fromJson(Map<String, dynamic> json) =>
      $CartoonModelDataFeedsComicInfoFromJson(json);

  Map<String, dynamic> toJson() => $CartoonModelDataFeedsComicInfoToJson(this);

  CartoonModelDataFeedsComicInfo copyWith({
    String? decision,
    String? lastestShortTitle,
    int? isFinish,
    String? mainStyleName,
    CartoonModelDataFeedsComicInfoRankInfo? rankInfo,
    double? score,
    List<String>? styles,
    List<String>? tags,
  }) {
    return CartoonModelDataFeedsComicInfo()
      ..decision = decision ?? this.decision
      ..lastestShortTitle = lastestShortTitle ?? this.lastestShortTitle
      ..isFinish = isFinish ?? this.isFinish
      ..mainStyleName = mainStyleName ?? this.mainStyleName
      ..rankInfo = rankInfo ?? this.rankInfo
      ..score = score ?? this.score
      ..styles = styles ?? this.styles
      ..tags = tags ?? this.tags;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class CartoonModelDataFeedsComicInfoRankInfo {
  String? name;
  int? rank;

  CartoonModelDataFeedsComicInfoRankInfo();

  factory CartoonModelDataFeedsComicInfoRankInfo.fromJson(Map<String, dynamic> json) =>
      $CartoonModelDataFeedsComicInfoRankInfoFromJson(json);

  Map<String, dynamic> toJson() => $CartoonModelDataFeedsComicInfoRankInfoToJson(this);

  CartoonModelDataFeedsComicInfoRankInfo copyWith({String? name, int? rank}) {
    return CartoonModelDataFeedsComicInfoRankInfo()
      ..name = name ?? this.name
      ..rank = rank ?? this.rank;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class CartoonModelDataFeedsLabels {
  String? id;
  String? name;

  CartoonModelDataFeedsLabels();

  factory CartoonModelDataFeedsLabels.fromJson(Map<String, dynamic> json) =>
      $CartoonModelDataFeedsLabelsFromJson(json);

  Map<String, dynamic> toJson() => $CartoonModelDataFeedsLabelsToJson(this);

  CartoonModelDataFeedsLabels copyWith({String? id, String? name}) {
    return CartoonModelDataFeedsLabels()
      ..id = id ?? this.id
      ..name = name ?? this.name;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class CartoonModelDataFeedsCombine {
  int? id;
  String? title;
  String? subtitle;
  int? booknum;
  int? period;
  List<dynamic>? books;

  CartoonModelDataFeedsCombine();

  factory CartoonModelDataFeedsCombine.fromJson(Map<String, dynamic> json) =>
      $CartoonModelDataFeedsCombineFromJson(json);

  Map<String, dynamic> toJson() => $CartoonModelDataFeedsCombineToJson(this);

  CartoonModelDataFeedsCombine copyWith({
    int? id,
    String? title,
    String? subtitle,
    int? booknum,
    int? period,
    List<dynamic>? books,
  }) {
    return CartoonModelDataFeedsCombine()
      ..id = id ?? this.id
      ..title = title ?? this.title
      ..subtitle = subtitle ?? this.subtitle
      ..booknum = booknum ?? this.booknum
      ..period = period ?? this.period
      ..books = books ?? this.books;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class CartoonModelDataFeedsRank {
  int? id;
  String? title;
  String? description;
  List<dynamic>? data;

  CartoonModelDataFeedsRank();

  factory CartoonModelDataFeedsRank.fromJson(Map<String, dynamic> json) =>
      $CartoonModelDataFeedsRankFromJson(json);

  Map<String, dynamic> toJson() => $CartoonModelDataFeedsRankToJson(this);

  CartoonModelDataFeedsRank copyWith({
    int? id,
    String? title,
    String? description,
    List<dynamic>? data,
  }) {
    return CartoonModelDataFeedsRank()
      ..id = id ?? this.id
      ..title = title ?? this.title
      ..description = description ?? this.description
      ..data = data ?? this.data;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class CartoonModelDataFeedsIpProduct {
  String? id;
  String? name;
  List<dynamic>? products;
  @JSONField(name: "new_product")
  bool? newProduct;

  CartoonModelDataFeedsIpProduct();

  factory CartoonModelDataFeedsIpProduct.fromJson(Map<String, dynamic> json) =>
      $CartoonModelDataFeedsIpProductFromJson(json);

  Map<String, dynamic> toJson() => $CartoonModelDataFeedsIpProductToJson(this);

  CartoonModelDataFeedsIpProduct copyWith({
    String? id,
    String? name,
    List<dynamic>? products,
    bool? newProduct,
  }) {
    return CartoonModelDataFeedsIpProduct()
      ..id = id ?? this.id
      ..name = name ?? this.name
      ..products = products ?? this.products
      ..newProduct = newProduct ?? this.newProduct;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class CartoonModelDataFeedsNovelInfo {
  int? numbers;

  CartoonModelDataFeedsNovelInfo();

  factory CartoonModelDataFeedsNovelInfo.fromJson(Map<String, dynamic> json) =>
      $CartoonModelDataFeedsNovelInfoFromJson(json);

  Map<String, dynamic> toJson() => $CartoonModelDataFeedsNovelInfoToJson(this);

  CartoonModelDataFeedsNovelInfo copyWith({List<dynamic>? styles, int? numbers}) {
    return CartoonModelDataFeedsNovelInfo()..numbers = numbers ?? this.numbers;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}
